use std::io::*;

fn main() {
    let stdin = stdin();
    let mut lines = stdin.lock().lines().map(|line| line.unwrap());

    let t: usize = lines.next().unwrap().trim().parse().unwrap(); // 读取测试数据组数

    for _ in 0..t {
        let v: Vec<f64> = lines
            .next()
            .unwrap()
            .split_whitespace()
            .map(|str| str.parse().unwrap())
            .collect();
        let a = v[0];
        let b = v[1];
        let c = v[2];

        // 计算判别式 delta
        let delta = 4.0 * (a * a - 2.0 * a * b * c);

        if delta < 0.0 {
            // 判别式小于0，无实数解，面积为0
            println!("0.0000000000");
            continue;
        }

        // 计算y1和y2
        let sqrt_delta_over_4 = (delta / 4.0).sqrt();
        let y1 = (a - sqrt_delta_over_4) / b;
        let y2 = (a + sqrt_delta_over_4) / b;

        // 计算r1和r2
        let r1 = (-y1.powi(3) / (6.0 * a)) + (y1.powi(2) / (2.0 * b)) - (y1 * c / b);
        let r2 = (-y2.powi(3) / (6.0 * a)) + (y2.powi(2) / (2.0 * b)) - (y2 * c / b);

        // 计算面积差并输出，保留10位小数
        let area = r2 - r1;
        println!("{0:.10}", area);
    }
}
